home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / eulisp / mpfeel.lha / MPFeel / Plurals / mp_gc.h < prev    next >
C/C++ Source or Header  |  1992-05-12  |  2KB  |  70 lines

  1. /*
  2.  *    MP_Lisp
  3.  *
  4.  *    Author:    S.C.Merrall
  5.  *
  6.  *    File:    mp_gc.h
  7.  *
  8.  *    Contents:    
  9.  *
  10.  *    Description:    Declarations of those things that need to be visible
  11.  *            to the rest of the lisp code. That is the memory
  12.  *            and the allocation routine.
  13.  *
  14.  *    Change History:
  15.  *
  16.  *    Date   Name Comment
  17.  *    -------- ---- -------
  18.  *    16:06:91 SCM  Created
  19.  *
  20.  */
  21.  
  22. extern plural heap_header heap_memory[];  /* All memory always visible */
  23.  
  24. #ifdef __STDC__
  25.  
  26. extern int mp_alloc( plural int, plural int, object );
  27. extern void mp_gc( void );
  28.  
  29. #else
  30.  
  31. extern int mp_alloc( );
  32. extern void mp_gc( );
  33.  
  34. #endif
  35.  
  36.  
  37. /*  GC MESSAGE: THis is so that we know what operation caused the GC
  38.  *  -- -------  Not that vital but coule be useful
  39.  */
  40.  
  41. extern char *gc_message;
  42.  
  43. #define set_gc_message(m) gc_message=dbg_g_fname
  44.  
  45.  
  46. /*  GC Protection: Way of adding extra roots to the gcer, this is so that
  47.  *                 temporary variable will be preserved if a GC is invoked
  48.  */
  49.  
  50. #define MAX_GC_ROOTS 15
  51.  
  52. extern int next_gc_root;
  53. extern plural natural *gc_roots[];
  54.  
  55. #define GC_Protect(arg) gc_roots[next_gc_root++]=((next_gc_root==MAX_GC_ROOTS) ? (plural natural *) fprintf(dbg,"%s :  ERROR, Exhausted GC Protect stack\n",dbg_fname) : (arg,/*printf("next_gc_root=%d\n",next_gc_root),*/&arg))
  56.  
  57. #define GC_UnProtect(n) (((next_gc_root-=n)<0) ? fprintf(dbg,"%s :  ERROR, GC Protect stack underflow\n",dbg_fname) : next_gc_root)
  58.  
  59. /* Scratch Memory: Work space, all the same size, on each processor,
  60.  * ------- ------  there is a scratch space on the the fe for the total
  61.  *                 scratch space on teh processor array.
  62.  */
  63.  
  64. #define SCRATCH_MEMORY_SIZE 64  /* 64 Bytes                      */
  65.  
  66. extern plural char scratch[];
  67. extern char   acu_scratch[];
  68.  
  69.  
  70.